package com.example.myapplication.login;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.example.myapplication.R;
import com.example.myapplication.acticity.BaseActivity;
import com.example.myapplication.acticity.HomeActivity;

public class MainActivity extends BaseActivity {

    private Button btnLogin,btnRegister,btnVisitor;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        binderPlayService();
        initView();

    }

    @Override
    public void publish(int progress) {

    }

    @Override
    public void change(int position) {

    }


    /**
     * 绑定组件并创建点击事件
     */
    private void initView() {

    btnLogin = findViewById(R.id.btn_login);
    btnLogin.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
           navigateTo(LoginActivity.class);
        }
    });

    btnRegister = findViewById(R.id.btn_register);
    btnRegister.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            navigateTo(RegisterActivity.class);
        }
    });

    btnVisitor = findViewById(R.id.visitor);
    btnVisitor.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            navigateTo(HomeActivity.class);
            finish();
        }
    });

    }
}
